package com.hu.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

/**
 * @author 00355760
 * @功能：
 * @版本： V1
 * @版权： 信息技术有限公司（http://www.mychery.com/）
 * @作者： 磐石战队开发组  00355760
 * @日期： 2024/12/19 10:09
 */
@Component
public class MyThreadService2 {

    private final ThreadPoolTaskExecutor taskExecutor;

    @Autowired
    public MyThreadService2(ThreadPoolTaskExecutor taskExecutor) {
        this.taskExecutor = taskExecutor;
    }

    public void executeAsyncTask2() {
        taskExecutor.execute(() -> {
            System.out.println("正在执行：" + Thread.currentThread().getName());
        });
    }

}
